<template>
  <div>
      <button @click="dj">点击</button>
    <a :href="url"><img src="@/assets/支付宝图标.png" alt=""></a>  
  </div>
</template>

<script>
export default {
    data(){
        return{
            url:'',
        }
    },
    methods:{
        dj(){
            this.$axios({
            "url":"pay",
            "method":"POST",
            "data":{
                "sn":20030528,  // 订单号
                "total":0.01,   // 总金额
            }
            }).then(resp=>{
                 console.log(resp.data)
                 this.url=resp.data.url
            })
        }

        
    }
}
</script>

<style>

</style>